/*
	Copyright (c) 2010 <copyright holders>
	This source code is licensed under The MIT License,
	see the file LICENSE for details.
	*/

#ifndef WORLDINPUTHANDLER_HPP
#define WORLDINPUTHANDLER_HPP

#include <OIS/OISMouse.h>
#include <set>

#include "ForwardDecls.hpp"
#include "HelpDefs.hpp"
#include "Spatial.hpp"

namespace spelprog2 {
namespace presentation {

class WorldInputHandler {
    HIDE_EVIL_CONSTRUCTORS(WorldInputHandler);

    Game & game_;
    WorldScene & scene_;

    bool rayPick(Ogre::int32 mask, float x, float y, Ogre::RaySceneQueryResultEntry & result, bool movable);
public:
    WorldInputHandler(Game & game, WorldScene & scene);

    void injectMouseMove(float normalizedX, float normalizedY);
    void injectMouseDown(float normalizedX, float normalizedY, OIS::MouseButtonID button);
    void injectMouseUp(float normalizedX, float normalizedY, OIS::MouseButtonID button);

    void lostMouseUp(); //in case GUI took mouse down but didn't get up
};

}; //presentation
}; //spelprog2

#endif //WORLDINPUTHANDLER_HPP
